package cc.verywell.pureblock.net;

import java.nio.ByteBuffer;
import cc.verywell.pureblock.util.EncryptUtil;

/**
* 
* Copyright 2019 TanYaqiu
* @author TanYaqiu 
* @address flat 601
* @date 2019年3月13日 下午8:45:19
*/
public interface HandshakeFunction<A> {
	static public int getSalt(byte[] hash) {
		int result = 1;
        for (byte element : hash)
            result = 31 * result + element;
       return result;
	}
	public void handshakeCompleted(A obj,EncryptUtil eu,ByteBuffer unread,int salt);
	public void handshakeFailed(A obj,Throwable exp);
}
